﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <style>
        div {
            height: 2000px;
        }
    </style>
</head>
<body>
    <div></div>

    <script>
        function getScroll() {
            var scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
            var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
            return {
                scrollLeft: scrollLeft,
                scrollTop: scrollTop
            };
        }

        function getPage(e) {
            var pageX = e.pageX || e.clientX + getScroll().scrollLeft;
            var pageY = e.pageY || e.clientY + getScroll().scrollTop;
            return {
                pageX: pageX,
                pageY: pageY
            };
        }

        document.onclick = function (e) {
            e = e || window.event;
            console.log(getPage(e));
        }

    </script>
</body>
</html>